<!doctype html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script src="../../assert_selection.js"></script>
<script>
selection_test(
  '<div contenteditable dir="ltr">|Lorem <span style="direction: ltr">ipsum dolor<div > just a test</div> sit</span> amet</div>',
  selection => selection.modify('extend', 'left', 'character'),
  '<div contenteditable dir="ltr">|Lorem <span style="direction: ltr">ipsum dolor<div> just a test</div> sit</span> amet</div>',
  '7-0 ltr left character');

selection_test(
  '<div contenteditable dir="ltr">L|orem <span style="direction: ltr">ipsum dolor<div > just a test</div> sit</span> amet</div>',
  selection => selection.modify('extend', 'left', 'character'),
  '<div contenteditable dir="ltr">|L^orem <span style="direction: ltr">ipsum dolor<div> just a test</div> sit</span> amet</div>',
  '7-1 ltr left character');

selection_test(
  '<div contenteditable dir="ltr">Lo|rem <span style="direction: ltr">ipsum dolor<div > just a test</div> sit</span> amet</div>',
  selection => selection.modify('extend', 'left', 'character'),
  '<div contenteditable dir="ltr">L|o^rem <span style="direction: ltr">ipsum dolor<div> just a test</div> sit</span> amet</div>',
  '7-2 ltr left character');

selection_test(
  '<div contenteditable dir="ltr">Lor|em <span style="direction: ltr">ipsum dolor<div > just a test</div> sit</span> amet</div>',
  selection => selection.modify('extend', 'left', 'character'),
  '<div contenteditable dir="ltr">Lo|r^em <span style="direction: ltr">ipsum dolor<div> just a test</div> sit</span> amet</div>',
  '7-3 ltr left character');

selection_test(
  '<div contenteditable dir="ltr">Lore|m <span style="direction: ltr">ipsum dolor<div > just a test</div> sit</span> amet</div>',
  selection => selection.modify('extend', 'left', 'character'),
  '<div contenteditable dir="ltr">Lor|e^m <span style="direction: ltr">ipsum dolor<div> just a test</div> sit</span> amet</div>',
  '7-4 ltr left character');

selection_test(
  '<div contenteditable dir="ltr">Lorem| <span style="direction: ltr">ipsum dolor<div > just a test</div> sit</span> amet</div>',
  selection => selection.modify('extend', 'left', 'character'),
  '<div contenteditable dir="ltr">Lore|m^ <span style="direction: ltr">ipsum dolor<div> just a test</div> sit</span> amet</div>',
  '7-5 ltr left character');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">|ipsum dolor<div > just a test</div> sit</span> amet</div>',
  selection => selection.modify('extend', 'left', 'character'),
  '<div contenteditable dir="ltr">Lorem| ^<span style="direction: ltr">ipsum dolor<div> just a test</div> sit</span> amet</div>',
  '7-6 ltr left character');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">i|psum dolor<div > just a test</div> sit</span> amet</div>',
  selection => selection.modify('extend', 'left', 'character'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">|i^psum dolor<div> just a test</div> sit</span> amet</div>',
  '7-7 ltr left character');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ip|sum dolor<div > just a test</div> sit</span> amet</div>',
  selection => selection.modify('extend', 'left', 'character'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">i|p^sum dolor<div> just a test</div> sit</span> amet</div>',
  '7-8 ltr left character');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ips|um dolor<div > just a test</div> sit</span> amet</div>',
  selection => selection.modify('extend', 'left', 'character'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ip|s^um dolor<div> just a test</div> sit</span> amet</div>',
  '7-9 ltr left character');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsu|m dolor<div > just a test</div> sit</span> amet</div>',
  selection => selection.modify('extend', 'left', 'character'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ips|u^m dolor<div> just a test</div> sit</span> amet</div>',
  '7-10 ltr left character');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum| dolor<div > just a test</div> sit</span> amet</div>',
  selection => selection.modify('extend', 'left', 'character'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsu|m^ dolor<div> just a test</div> sit</span> amet</div>',
  '7-11 ltr left character');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum |dolor<div > just a test</div> sit</span> amet</div>',
  selection => selection.modify('extend', 'left', 'character'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum| ^dolor<div> just a test</div> sit</span> amet</div>',
  '7-12 ltr left character');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum d|olor<div > just a test</div> sit</span> amet</div>',
  selection => selection.modify('extend', 'left', 'character'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum |d^olor<div> just a test</div> sit</span> amet</div>',
  '7-13 ltr left character');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum do|lor<div > just a test</div> sit</span> amet</div>',
  selection => selection.modify('extend', 'left', 'character'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum d|o^lor<div> just a test</div> sit</span> amet</div>',
  '7-14 ltr left character');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dol|or<div > just a test</div> sit</span> amet</div>',
  selection => selection.modify('extend', 'left', 'character'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum do|l^or<div> just a test</div> sit</span> amet</div>',
  '7-15 ltr left character');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolo|r<div > just a test</div> sit</span> amet</div>',
  selection => selection.modify('extend', 'left', 'character'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dol|o^r<div> just a test</div> sit</span> amet</div>',
  '7-16 ltr left character');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div >| just a test</div> sit</span> amet</div>',
  selection => selection.modify('extend', 'left', 'character'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor|<div>^ just a test</div> sit</span> amet</div>',
  '7-17 ltr left character');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div > |just a test</div> sit</span> amet</div>',
  selection => selection.modify('extend', 'left', 'character'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor|<div>^ just a test</div> sit</span> amet</div>',
  '7-18 ltr left character');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div > j|ust a test</div> sit</span> amet</div>',
  selection => selection.modify('extend', 'left', 'character'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div> |j^ust a test</div> sit</span> amet</div>',
  '7-19 ltr left character');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div > ju|st a test</div> sit</span> amet</div>',
  selection => selection.modify('extend', 'left', 'character'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div> j|u^st a test</div> sit</span> amet</div>',
  '7-20 ltr left character');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div > jus|t a test</div> sit</span> amet</div>',
  selection => selection.modify('extend', 'left', 'character'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div> ju|s^t a test</div> sit</span> amet</div>',
  '7-21 ltr left character');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div > just| a test</div> sit</span> amet</div>',
  selection => selection.modify('extend', 'left', 'character'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div> jus|t^ a test</div> sit</span> amet</div>',
  '7-22 ltr left character');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div > just |a test</div> sit</span> amet</div>',
  selection => selection.modify('extend', 'left', 'character'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div> just| ^a test</div> sit</span> amet</div>',
  '7-23 ltr left character');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div > just a| test</div> sit</span> amet</div>',
  selection => selection.modify('extend', 'left', 'character'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div> just |a^ test</div> sit</span> amet</div>',
  '7-24 ltr left character');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div > just a |test</div> sit</span> amet</div>',
  selection => selection.modify('extend', 'left', 'character'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div> just a| ^test</div> sit</span> amet</div>',
  '7-25 ltr left character');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div > just a t|est</div> sit</span> amet</div>',
  selection => selection.modify('extend', 'left', 'character'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div> just a |t^est</div> sit</span> amet</div>',
  '7-26 ltr left character');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div > just a te|st</div> sit</span> amet</div>',
  selection => selection.modify('extend', 'left', 'character'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div> just a t|e^st</div> sit</span> amet</div>',
  '7-27 ltr left character');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div > just a tes|t</div> sit</span> amet</div>',
  selection => selection.modify('extend', 'left', 'character'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div> just a te|s^t</div> sit</span> amet</div>',
  '7-28 ltr left character');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div > just a test</div>| sit</span> amet</div>',
  selection => selection.modify('extend', 'left', 'character'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div> just a test|</div>^ sit</span> amet</div>',
  '7-29 ltr left character');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div > just a test</div> |sit</span> amet</div>',
  selection => selection.modify('extend', 'left', 'character'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div> just a test|</div>^ sit</span> amet</div>',
  '7-30 ltr left character');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div > just a test</div> s|it</span> amet</div>',
  selection => selection.modify('extend', 'left', 'character'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div> just a test</div> |s^it</span> amet</div>',
  '7-31 ltr left character');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div > just a test</div> si|t</span> amet</div>',
  selection => selection.modify('extend', 'left', 'character'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div> just a test</div> s|i^t</span> amet</div>',
  '7-32 ltr left character');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div > just a test</div> sit</span>| amet</div>',
  selection => selection.modify('extend', 'left', 'character'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div> just a test</div> si|t^</span> amet</div>',
  '7-33 ltr left character');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div > just a test</div> sit</span> |amet</div>',
  selection => selection.modify('extend', 'left', 'character'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div> just a test</div> sit</span>| ^amet</div>',
  '7-34 ltr left character');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div > just a test</div> sit</span> a|met</div>',
  selection => selection.modify('extend', 'left', 'character'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div> just a test</div> sit</span> |a^met</div>',
  '7-35 ltr left character');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div > just a test</div> sit</span> am|et</div>',
  selection => selection.modify('extend', 'left', 'character'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div> just a test</div> sit</span> a|m^et</div>',
  '7-36 ltr left character');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div > just a test</div> sit</span> ame|t</div>',
  selection => selection.modify('extend', 'left', 'character'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div> just a test</div> sit</span> am|e^t</div>',
  '7-37 ltr left character');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div > just a test</div> sit</span> amet|</div>',
  selection => selection.modify('extend', 'left', 'character'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor<div> just a test</div> sit</span> ame|t^</div>',
  '7-38 ltr left character');
</script>
